package com.choudou5.webflux.config;

import com.choudou5.webflux.dao.DemoDao;
import com.choudou5.webflux.dao.RedisDemoDao;
import com.choudou5.webflux.service.DefaultDemoService;
import com.choudou5.webflux.service.DemoService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;

@Configuration
public class BeanConfig {

    @Bean
    public DemoDao demoDao(ReactiveStringRedisTemplate template) {
        return new RedisDemoDao(template);
    }

    @Bean
    public DemoService goodsService(DemoDao demoDao) {
        return new DefaultDemoService(demoDao);
    }
}
